package cn.laixueit.mapper;

import cn.laixueit.cart.pojo.item.Brand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {

    @Insert("insert into tb_category_brand values(#{cid},#{bid})")
    void savecategoryAndBrand(Long cid,Long bid);

    @Select("select * from tb_brand where id in " +
            "(" +
            " select brand_id from tb_category_brand where category_id = #{cid} " +
            " )")
    List<Brand> cid(@Param("cid") Long cid);
}
